#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :models.py
# @Time      :2024/11/8 8:58
# @Author    :Darcy
# @Desc      :
import uuid

from django.db import models


class BackUserContactInfoTable(models.Model):
    """外部联系人详情表"""
    STATUS_NORMAL = 1
    STATUS_DELETE = 0
    STATUS_ITEMS = ((STATUS_NORMAL, '正常'), (STATUS_DELETE, '删除'))

    id = models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True)

    user_id = models.CharField(max_length=64, verbose_name='外部联系人id', db_index=True)
    external_userid = models.CharField(max_length=64, verbose_name='external_userid', default='',null=True,blank=True)
    union_id = models.CharField(max_length=64, verbose_name='unionid', default='',null=True,blank=True)
    name = models.CharField(max_length=64, verbose_name='名称', default='',null=True,blank=True)
    header = models.CharField(max_length=128, verbose_name='头像', default='',null=True,blank=True)
    gender = models.CharField(max_length=64, verbose_name='性别', default='',null=True,blank=True)
    position = models.CharField(max_length=64, verbose_name='职位', default='',null=True,blank=True)
    remark_mobiles = models.CharField(max_length=64, verbose_name='备注手机号', default='',null=True,blank=True)
    remark = models.CharField(max_length=64, verbose_name='备注', default='',null=True,blank=True)
    corp_name = models.CharField(max_length=128, verbose_name='所在企业', default='',null=True,blank=True)
    user_type = models.PositiveIntegerField(default=0, verbose_name='外部联系人的类型 1 wx 2qywx')
    add_way = models.PositiveIntegerField(default=0, verbose_name='add_way 添加方式')
    add_time = models.DateTimeField(default=None, verbose_name='添加时间',null=True,blank=True)
    status = models.PositiveIntegerField(default=STATUS_NORMAL,
                                         choices=STATUS_ITEMS, verbose_name="状态")
    created_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    deleted_time = models.DateTimeField(null=True, blank=True, default=None, verbose_name='删除时间')

    class Meta:
        verbose_name = verbose_name_plural = '外部联系人详情表'
        db_table = 'back_user_contact_info'
